﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using ADO;

namespace Service.Login
{
    public class LaborialStaff:LogIn
    {
       override public bool  EnterInterface()
        {
            return true;
        }
        //------------------------------
       override public  void Initialize(String t_name,String t_password)
        {
            name      = t_name;
            password  = t_password;
        }
        //------------------------------------------------------
       override public bool  IsLegal()
        {
            String sqlstr = "";
            //DataSet DataTable;
            string psw;
           if(name == ""|| password == "")
               return false;
            sqlstr = "select Psw from Staff where name='"+name+"'";
           DataBaseAccess DAO=new DataBaseAccess();
            psw = DAO.GetScalar(sqlstr);
           if (psw!=null)
           {
               if (psw.Equals(password))
               {
                   return true;
               }
           }
            //if(DataTable.Tables[0].Rows[0].ToString() != password || psw==null )
            //    return false;
            return false;
        }
        //-------------------------------------------------------------
       override public bool  Record()
        {
           return true;
        }
        //-----------------------------------------------------------
        private String   name;
        private String   password;
    }
}
